<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ include file="/include/taglibs.jsp" %>
<html>
<head>
    <%@include file="/include/header.html" %>
    <script type="text/javascript" src="${ctx}/appjs/order/orderInfo/operatorExceptionOrderInfo.js"></script>
    <link rel="stylesheet" href="${ctx}/statics/css/update.css">
    <link rel="stylesheet" href="${ctx}/statics/css/common.css">
    <link rel="stylesheet" href="${ctx}/libjs/plugins/bootstrap-table-pagejump/bootstrap-table-pagejump.css">
    <script src="${ctx}/libjs/plugins/bootstrap-table-pagejump/bootstrap-table-pagejump.js"></script>
    <%--<link rel="stylesheet" href="${ctx}/libjs/plugins/laydate/skins/laydate.css">--%>
    <link rel="stylesheet" href="${ctx}/libjs/plugins/laydate/laydate.css">
    <script src="${ctx}/libjs/plugins/laydate/laydate.js"></script>
    <link rel="stylesheet" href="${ctx}/libjs/plugins/bootStrap-table-fixed-column/bootstrap-table-fixed-columns.css">
    <script src="${ctx}/libjs/plugins/bootStrap-table-fixed-column/bootstrap-table-fixed-columns.js"></script>
</head>


<script type="text/javascript">
    $('#topLink', window.parent.document).html(function (i, origText) {
        return '<ol class="breadcrumb">' +
            '<li class="breadcrumb-item">' +
            '<a href="">主页</a>' +
            '</li>' +
            '<li class="breadcrumb-item">' +
            '<a>订单管理</a>' +
            '</li>' +
            '<li class="breadcrumb-item">' +
            '<strong>异常订单修复记录</strong>' +

            '</li>' +
            '</ol>';
    });

    var has_add = '';
    var has_edit = '';
    var has_delete = '';

</script>

<body class="gray-bg orderInfoBody">
<div class="wrapper wrapper-content " style="overflow-x: scroll">
    <div class="col-sm-12">
        <div class="ibox">
            <div class="ibox-body">
                <div class="row">
                    <input id="stationName" name="stationName" type="text" autocomplete="off"
                           class="form-control shortInput"
                           placeholder="桩群名">
                    <input id="gunNo" name="gunNo" type="text" class="form-control shortInput input-distance"
                           placeholder="枪号">
                    <input id="orderNum" name="orderNum" type="text" class="form-control input-distance longInput"
                           placeholder="订单号或者外部订单号">
                    <input id="nickname" name="nickname" type="text" class="form-control shortInput input-distance"
                           placeholder="会员名">
                    <input id="mobile" name="mobile" type="text" class="form-control shortInput input-distance"
                           placeholder="手机号">
                    <div class="pull-left search fr exportNumInput">
                        <input id="count" name="count" type="text" class="form-control" autocomplete="off"
                               placeholder="导出条数">
                    </div>
                    <div class="pull-left search fr">
                        <button class="btn btn-success exportBtn" onclick="operatorExceptionOrderInfo.exportOrderInfo()">导出</button>
                    </div>
                </div>
                <div class="row">
                    <input id="startTime" name="startTime" type="text"
                           class="form-control layer-date timeInput" autocomplete="false"
                           placeholder="开始时间">
                    <input id="endTime" name="endTime" type="text"
                           class="form-control layer-date input-distance timeInput" autocomplete="false"
                           placeholder="结束时间">
                    <button class="btn btn-success input-distance" onclick="operatorExceptionOrderInfo.reLoad()">查询</button>
                </div>
                <input id="userTenantCode" name="userTenantCode" type="hidden" value="${user.tenantCode}"><%-- 当前登录用户的tenantCode --%>
            </div>
            <div class="table-responsive" style="z-index: 1;">
                <table id="exampleTable" style="word-break:break-all;" data-mobile-responsive="true">
                    <%--<tbody>--%>
                    <%--<img src="${ctx}/statics/img/newEdition/pageLoading.gif" alt="">--%>
                    <%--</tbody>--%>

                </table>
            </div>


            <%--  驳回原因模态框  --%>
            <div class="modal fade" id="exampleModal" tabindex="-1" role="dialog"
                 aria-labelledby="exampleModalLabel">
                <div class="modal-dialog" role="document">
                    <div class="modal-content">
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                                    aria-hidden="true"></span></button>
                            <h4 class="modal-title" id="exampleModalLabel" data-dismiss="modal" aria-label="Close">
                                关闭</h4>
                        </div>
                        <div class="modal-body">
                            <form id="contentForm" class="layui-form">
                                <div class="form-group row"
                                     style="margin-bottom: 0px !important;margin-top: 20px !important;">
                                    <label class="col-sm-4 col-form-label text-right">驳回原因:</label>
                                    <div class="col-sm-8">
                                        <textarea rows="5" cols="50" id="rejectionReason"></textarea>
                                    </div>
                                </div>
                            </form>
                        </div>
                        <div class="modal-footer">
                            <button type="button" class="btn btn-success" id="submitBtn">确认</button>
                            <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                        </div>
                    </div>
                </div>
            </div>
            <%--</div>--%>
        </div>
    </div>
</div>
<%--<script src="http://cn.inspinia.cn/html/inspiniacn/hplus/js/plugins/layer/laydate/laydate.js"></script>--%>
<script type="text/javascript">

    var thisDate = new Date();
    var year = thisDate.getFullYear();
    var month = thisDate.getMonth() + 1;
    var date = thisDate.getDate();
    if (month < 10) {
        month = '0' + month
    }
    if (date < 10) {
        date = '0' + date
    }
    $('#startTime').val(year + '-' + month + '-' + date + ' ' + '00:00:00');
</script>
</body>
</html>
<script>
    // //日期范围限制
    var start = {
        elem: '#startTime',
        format: 'YYYY-MM-DD hh:mm:ss',
        // theme: '#3195f0',
        // min: laydate.now(), //设定最小日期为当前日期
        // max: '2099-06-16 23:59:59', //最大日期
        istime: true,
        istoday: false,
        choose: function (datas) {
            $("#endTime").val("")
            end.min = datas
        }
    };
    var end = {
        elem: '#endTime',
        format: 'YYYY-MM-DD hh:mm:ss',
        // theme: '#3195f0',
        // min: laydate.now(),
        // max: '2099-06-16 23:59:59',
        istime: true,
        istoday: false,
        choose: function (datas) {
            start.max = datas; //结束日选好后，重置开始日的最大日期
        }
    };
    laydate(start);
    laydate(end);
    laydate.skin('molv');//皮肤

    operatorExceptionOrderInfo.init();
</script>
<script>
    //分销商下拉框
    function listTenantOperator() {
        $.ajax({
            "url": prefix + "/listTenantOperator",
            "type": "GET",
            "data": {},
            "success": function (data) {
                //console.log(data);
                $("#tenantOperator").html("")

                // var hlhtType = $("#hlhtType").val();

                var str = '<option value="" >所属分销商</option>'
                if (data.data) {
                    for (var i = 0; i < data.data.length; i++) {
                        str += "<option value=" + data.data[i].tenantOperatorCode + " >" + data.data[i].operatorName + "</option>";

                    }
                }

                $("#tenantOperator").append(str);
                $("#tenantOperator + div").remove()
                $('#tenantOperator').searchableSelect();
                //console.log(str)

            },
            "complete": function () {
            }
        })
    }

    function listHlhtOperator(hlhtOrderType, hlhtType) {
        $.ajax({
            "url": prefix + "/listHlhtOperator",
            "type": "GET",
            "data": {
                'hlhtType': hlhtType,
                'hlhtOrderType': hlhtOrderType
            },
            "success": function (data) {
                //console.log(data);
                $("#hlhtOperatorId").html("")

                var hlhtType = $("#hlhtType").val();

                var str = '<option value="" >互联运营商</option>'
                if (data.data) {

                    if (hlhtType == "0") {
                        for (var i = 0; i < data.data.length; i++) {
                            str += "<option value=" + data.data[i].tenantCode + " >" + data.data[i].tenantName + "</option>";

                        }
                    } else {
                        for (var i = 0; i < data.data.length; i++) {
                            str += "<option value=" + data.data[i].hlhtOperatorId + " >" + data.data[i].hlhtOperatorName + "</option>";

                        }
                    }
                }

                $("#hlhtOperatorId").append(str);
                $("#hlhtOperatorId + div").remove()
                $('#hlhtOperatorId').searchableSelect();
                //console.log(str)

            },
            "complete": function () {
            }
        })
    }
    listTenantOperator();
    listHlhtOperator("");

    $("#hlhtType").change(function () {
        var hlhtOrderType = $("#hlhtOrderType").val();
        var hlhtType = $("#hlhtType").val();
        listHlhtOperator(hlhtOrderType, hlhtType)
    })

    $("#hlhtOrderType").change(function () {
        var hlhtOrderType = $("#hlhtOrderType").val();
        var hlhtType = $("#hlhtType").val();
        listHlhtOperator(hlhtOrderType, hlhtType)
    })
</script>
<script type="text/javascript">
    $(function () {
        $('#hlhtOrderType').searchableSelect();
    })
    $(function () {
        $('#hlhtType').searchableSelect();
    })
</script>

